#include "stdafx.h"
#include "export.h"

BOOL
conncetToMysql(
	OUT MYSQL		&mysql, 
	IN char*			    pszSerIP, 
	IN char*				pszUserName, 
	IN char*				pszPWD,
	IN	char*			pszDBName,
	IN UINT				unPort	
	)
{
    MYSQL tmysql;
	BOOL bStatus = FALSE;
	mysql_init ( &tmysql );
	do 
	{
		if( !mysql_real_connect( &tmysql,
											pszSerIP, 
											pszUserName,
											pszPWD,
											pszDBName,
											3306,
											NULL,
											0) 
			) 
		{
			break;
		}
		
		bStatus = TRUE;

	} while( FALSE );

	return bStatus;
}